package com.hellowx_ssm.mybatis_spring;

import com.hellowx_ssm.mybatis_spring.entity.User;
import com.hellowx_ssm.mybatis_spring.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by IntelliJ IDEA.
 *
 * @author MagicMushroom
 * @date 2021/6/19
 */
public class Test {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("/applicationContext.xml");
//        UserDAO userDAO = (UserDAO) ctx.getBean("userDAO");
//        userDAO.save(new User("cccc",21));
        UserService userService = (UserService) ctx.getBean("userService");
//        User wx = userService.login(new User("wx", 21));
//        System.out.println(wx);
        userService.register(new User("adada",21));
    }
}
